package com.zzj.controller;


import com.zzj.bean.CityBean;
import com.zzj.service.CityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("city")
@Api
@CrossOrigin
public class CityController {

    @Resource
    private CityService cityService;

    @GetMapping("city/{pid}")
    @ApiOperation("或得省份对应的所有市")
    public List<CityBean> getByPid(@PathVariable Integer pid){
       return cityService.getCityByPid(pid);
    }

}
